<!DOCTYPE html>
<html>
<head>
	{% load staticfiles %}
	<title>{% block title %}{{ title }}{% endblock %}</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<link rel="shortcut icon" type="image/png" href="{% static "images/favicon.png" %}" />
	
	<link rel="stylesheet" type="text/css" href="{% static "css/layout.css" %}" />
	<link rel="stylesheet" type="text/css" href="{% static "css/content.css" %}" />
	<link rel="stylesheet" type="text/css" href="{% static "js/star-rating/jquery.rating.css" %}" />
	
	<link rel="stylesheet" type="text/css" href="{% static "css/dj.selectable.css" %}" />
	
	<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
	<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js"></script>
	<script type="text/javascript" src="{% static "js/star-rating/jquery.form.js" %}" ></script>
	<script type="text/javascript" src="{% static "js/star-rating/jquery.MetaData.js" %}" ></script>
	<script type="text/javascript" src="{% static "js/star-rating/jquery.rating.pack.js" %}" ></script>
	<script type="text/javascript" src="{% static "js/star-rating/jquery.rating.js" %}" ></script>
	<script type="text/javascript" src="{% static "js/jquery.dj.selectable.js" %}" ></script>
</head>
<body>
<div id="nav_wrapper">
	<nav>
		<a href="/" style="float:left;"><div id="logo"></div></a> 
		<ul>
			<li>&nbsp;&nbsp;&nbsp;</li>
			<li><a href="/recipes">All recipes</a></li>
		
		{% if user.is_authenticated %}
			<li><a href="/my_recipes">My recipes</a></li>
			<li><a href="/filter">My Filter</a></li>
			<li><form name="use_filter" style="display:inline-block" action="/use_filter" method="post"><input type="checkbox" id="filter" name="filter" title="use filter?" onchange="this.form.submit()"><input type="hidden" name="res_url" value="{{request.get_full_path}}" /></form></li>
			<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
			<li><a href="/profile">My profile</a></li>
			<li><a href="/logout" style="color:#CCC">Logout</a></li>
		{% else %}
			<li><a href="/login">Login / Register</a></li>
		{% endif %}
		</ul>
		<form action="/search_recipe/" method="post">
		<input id="searchstring" name="searchstring" autocomplete="off" style="width:150px" />
		</form>
		<div id="results"></div>
		
	</nav>
	
</div>
<script>
$(document).ready(function() {
	$('#searchstring').bind('keyup', function() {
		q = $('#searchstring').val();
		
	$('#results').load('/ajax_search?q='+q);

	});
});
</script>
<div id="wrapper">
<article>
	{% block content %}{{content}}{% endblock %}
</article>

<footer>
	&copy; 2013 cookit
	<br>
	<a href="/admin" target="_blank">Admin</a> | <a href="/rss" target="_blank">RSS Feed</a>
</footer>
</div>
<script type="text/javascript">
	document.use_filter.filter.checked = {{ request.session.user_filter }};
</script>
</body>
</html>